package com.wjy.rbac.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.wjy.common.base.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author ybxxszl
 * @since 2019-04-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bd_user")
@ApiModel(value = "User对象", description = "")
public class User extends BaseEntity {

    @ApiModelProperty(value = "用户ID")
    @TableId(value = "user_id", type = IdType.UUID)
    private String userId;

    @ApiModelProperty(value = "账号")
    @TableField("account")
    private String account;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "姓名")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "性别")
    @TableField("sex")
    private String sex;

    @ApiModelProperty(value = "出生日期")
    @TableField("birthday")
    private Date birthday;

    @ApiModelProperty(value = "电话号码")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "电子邮件")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "照片")
    @TableField("photo")
    private String photo;

    @ApiModelProperty(value = "状态 0不可用 1可用")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "逻辑删除")
    @TableField(value = "logic_delete", fill = FieldFill.INSERT)
    @TableLogic
    private Integer logicDelete;

    @ApiModelProperty(value = "乐观锁")
    @TableField(value = "version", fill = FieldFill.INSERT)
    @Version
    private Integer version;

    @ApiModelProperty(value = "添加人ID")
    @TableField(value = "insert_id", fill = FieldFill.INSERT)
    private String insertId;

    @ApiModelProperty(value = "添加时间")
    @TableField(value = "insert_time", fill = FieldFill.INSERT)
    private Date insertTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private String updateId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    public static final String USER_ID = "user_id";

    public static final String ACCOUNT = "account";

    public static final String PASSWORD = "password";

    public static final String NAME = "name";

    public static final String SEX = "sex";

    public static final String BIRTHDAY = "birthday";

    public static final String PHONE = "phone";

    public static final String EMAIL = "email";

    public static final String PHOTO = "photo";

    public static final String STATUS = "status";

    public static final String LOGIC_DELETE = "logic_delete";

    public static final String VERSION = "version";

    public static final String INSERT_ID = "insert_id";

    public static final String INSERT_TIME = "insert_time";

    public static final String UPDATE_ID = "update_id";

    public static final String UPDATE_TIME = "update_time";

}
